package com.ufgov.zc.server.commonbiz.dao.ibatis;

import java.util.List;

import org.springframework.orm.ibatis.support.SqlMapClientDaoSupport;

import com.ufgov.zc.common.commonbiz.model.MaCompany;
import com.ufgov.zc.common.commonbiz.model.MaCompanyExample;
import com.ufgov.zc.common.commonbiz.model.MaCompanyKey;
import com.ufgov.zc.server.commonbiz.dao.IMaCompanyDAO;

public class MaCompanyDAOImpl extends SqlMapClientDaoSupport implements IMaCompanyDAO {

  /**
   * This field was generated by Apache iBATIS ibator. This field corresponds to the database table MA_COMPANY
   * @ibatorgenerated  Tue Jul 09 02:33:33 CST 2013
   */

  /**
   * This method was generated by Apache iBATIS ibator. This method corresponds to the database table MA_COMPANY
   * @ibatorgenerated  Tue Jul 09 02:33:33 CST 2013
   */
  public int countByExample(MaCompanyExample example) {
    Integer count = (Integer) this.getSqlMapClientTemplate().queryForObject("MA_COMPANY.ibatorgenerated_countByExample", example);
    return count.intValue();
  }

  /**
   * This method was generated by Apache iBATIS ibator. This method corresponds to the database table MA_COMPANY
   * @ibatorgenerated  Tue Jul 09 02:33:33 CST 2013
   */
  public int deleteByExample(MaCompanyExample example) {
    int rows = this.getSqlMapClientTemplate().delete("MA_COMPANY.ibatorgenerated_deleteByExample", example);
    return rows;
  }

  /**
   * This method was generated by Apache iBATIS ibator. This method corresponds to the database table MA_COMPANY
   * @ibatorgenerated  Tue Jul 09 02:33:33 CST 2013
   */
  public int deleteByPrimaryKey(MaCompanyKey key) {
    int rows = this.getSqlMapClientTemplate().delete("MA_COMPANY.ibatorgenerated_deleteByPrimaryKey", key);
    return rows;
  }

  /**
   * This method was generated by Apache iBATIS ibator. This method corresponds to the database table MA_COMPANY
   * @ibatorgenerated  Tue Jul 09 02:33:33 CST 2013
   */
  public void insert(MaCompany record) {
    this.getSqlMapClientTemplate().insert("MA_COMPANY.ibatorgenerated_insert", record);
  }

  /**
   * This method was generated by Apache iBATIS ibator. This method corresponds to the database table MA_COMPANY
   * @ibatorgenerated  Tue Jul 09 02:33:33 CST 2013
   */
  public void insertSelective(MaCompany record) {
    this.getSqlMapClientTemplate().insert("MA_COMPANY.ibatorgenerated_insertSelective", record);
  }

  /**
   * This method was generated by Apache iBATIS ibator. This method corresponds to the database table MA_COMPANY
   * @ibatorgenerated  Tue Jul 09 02:33:33 CST 2013
   */
  public List selectByExample(MaCompanyExample example) {
    List list = this.getSqlMapClientTemplate().queryForList("MA_COMPANY.ibatorgenerated_selectByExample", example);
    return list;
  }

  /**
   * This method was generated by Apache iBATIS ibator. This method corresponds to the database table MA_COMPANY
   * @ibatorgenerated  Tue Jul 09 02:33:33 CST 2013
   */
  public MaCompany selectByPrimaryKey(MaCompanyKey key) {
    MaCompany record = (MaCompany) this.getSqlMapClientTemplate().queryForObject("MA_COMPANY.ibatorgenerated_selectByPrimaryKey", key);
    return record;
  }

  /**
   * This method was generated by Apache iBATIS ibator. This method corresponds to the database table MA_COMPANY
   * @ibatorgenerated  Tue Jul 09 02:33:33 CST 2013
   */
  public int updateByExampleSelective(MaCompany record, MaCompanyExample example) {
    UpdateByExampleParms parms = new UpdateByExampleParms(record, example);
    int rows = this.getSqlMapClientTemplate().update("MA_COMPANY.ibatorgenerated_updateByExampleSelective", parms);
    return rows;
  }

  /**
   * This method was generated by Apache iBATIS ibator. This method corresponds to the database table MA_COMPANY
   * @ibatorgenerated  Tue Jul 09 02:33:33 CST 2013
   */
  public int updateByExample(MaCompany record, MaCompanyExample example) {
    UpdateByExampleParms parms = new UpdateByExampleParms(record, example);
    int rows = this.getSqlMapClientTemplate().update("MA_COMPANY.ibatorgenerated_updateByExample", parms);
    return rows;
  }

  /**
   * This method was generated by Apache iBATIS ibator. This method corresponds to the database table MA_COMPANY
   * @ibatorgenerated  Tue Jul 09 02:33:33 CST 2013
   */
  public int updateByPrimaryKeySelective(MaCompany record) {
    int rows = this.getSqlMapClientTemplate().update("MA_COMPANY.ibatorgenerated_updateByPrimaryKeySelective", record);
    return rows;
  }

  /**
   * This method was generated by Apache iBATIS ibator. This method corresponds to the database table MA_COMPANY
   * @ibatorgenerated  Tue Jul 09 02:33:33 CST 2013
   */
  public int updateByPrimaryKey(MaCompany record) {
    int rows = this.getSqlMapClientTemplate().update("MA_COMPANY.ibatorgenerated_updateByPrimaryKey", record);
    return rows;
  }

  /**
   * This class was generated by Apache iBATIS ibator. This class corresponds to the database table MA_COMPANY
   * @ibatorgenerated  Tue Jul 09 02:33:33 CST 2013
   */
  private static class UpdateByExampleParms extends MaCompanyExample {
    private Object record;

    public UpdateByExampleParms(Object record, MaCompanyExample example) {
      super(example);
      this.record = record;
    }

    public Object getRecord() {
      return record;
    }
  }
}